$html_elements
$html_elements : array
Utility class providing HTML sanitizer
$html_elements : array
$ignore_elements : array
$html_attribs : array
$void_elements : array
$body_attribs : array
$extlinks : bool
$config : array
$handlers : array
$_html_elements : array
$_ignore_elements : array
$_void_elements : array
$_html_attribs : array
$_css_prefix : string
$max_nesting_level : int
$max_nesting_level_error : bool
$is_xml : bool
__construct(array $p = []) : mixed
Class constructor
array | $p | Configuration options:
allow_remote: is a boolean to allow link to remote resources (images/css)
blocked_src: string with image-src to be used for blocked remote images
show_washed: is a boolean to include washed out attributes as x-washed
cid_map: is an array where cid urls index urls to replace them
charset: is a string containing the charset of the HTML document,
to be used if the charset is not defined in the document
css_prefix: A prefix to be added to id/class/for attribute values
html_elements: Additional allowed HTML elements
ignore_elements: Additional HTML elements to ignore
html_attribs: Additional allowed HTML attributes
void_elements: Elements which could be empty and be returned in short form ( |
attribute_value(\DOMElement $node, string $attr_name, string $attr_value) : bool
Check if a specified element has an attribute with specified value.
Do it in case-insensitive manner.
\DOMElement | $node | The element |
string | $attr_name | The attribute name |
string | $attr_value | The attribute value to find |
True if the specified attribute exists and has the expected value
dumpHtml(\DOMNode $node, int $level = 20) : string
The main loop that recurse on a node tree.
It output only allowed tags with allowed attributes and allowed inline styles
\DOMNode | $node | HTML element |
int | $level | Recurrence level (safe initial value found empirically) |
HTML content